package com.smart.manager.work.views;

import com.smart.common.entities.core.BaseView;
import com.smart.manager.member.entities.views.MemberPigView;
import com.smart.manager.work.entities.enums.PigOrderStatus;
import io.ebean.annotation.View;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * 管家视图
 * @author leo
 * @date 2023/09/21
 */
@Data
@Entity
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@View(name = "work_pig_order")
public class OrderView extends BaseView {


    @ApiModelProperty("工单ID")
    @Id
    private Long id;

    @ApiModelProperty("工单编号")
    private String code;

    @ApiModelProperty("猪仔")
    @ManyToOne
    @JoinColumn(name = "pig",referencedColumnName = "id")
    private MemberPigView pig;

    @ApiModelProperty("订单状态")
    private PigOrderStatus status;

    @ApiModelProperty("视频地址")
    private String video;

}
